#include <bits/stdc++.h>
using namespace std;

int power(int a, int n) {
  int ans = 1;
  int a = 1;
  while (n > 0) {
    if (n & 1) {
      ans = ans * a;
    }
    a = a * a;
    n = n >> 1;
  }
  return ans;
}

void mulself(int A[2][2]) {
  int temp[2][2];
  memset(temp, 0, sizeof(temp));
  for (int i = 0; i < 2; i++) {
    for (int j = 0; j < 2; j++) {
      for (int k = 0; k < 2; k++) {
        temp[i][j] += A[i][k] * A[k][j];
      }
    }
  }
  memcpy(A, temp, sizeof(temp));
}

void mul(int f[2], int a[2][2]) {
  int temp[2];
  memset(temp, 0, sizeof(temp));
  for (int j = 0; j < 2; j++) {
    for (int k = 0; k < 2; k++) {
      temp[j] += f[k] * a[k][j];
    }
  }
  memcpy(f, temp, sizeof(temp));
}

int main() {
  int n;
  cin >> n;
  int M[2] = {1, 1};
  int A[2][2] = {{0, 1}, {1, 1}};
  n--;
  while (n > 0) {
    if (n & 1) {
      mul(M, A);
    }
    mulself(A);
    n = n >> 1;
  }
  cout << M[0];
  return 0;
}